<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var obj = {
            name: "老王",
            age: 25
        }
        var newobj = Object.create(obj, {
           sex:{
            value:"男",
            writable :true    //writable : 标识当前属性值是否是可修改的, 默认为 false
           }
        })
        console.log(newobj)
        obj.name="老刘"
        console.log(obj)
        newobj.sex=66
        console.log(newobj)
        for(var iteam in obj){
            console.log(obj[iteam])
        }

    </script>
</body>

</html>